{{include file="header.html"}}
<div class="header loginhead">
	<div class="nav">
	    <div class="search return"><a {{if $smarty.get.aid}}href="index.php?app=order&address&id={{$smarty.get.aid}}"{{else}}href="index.php?app=My"{{/if}}></a></div>
	    <div class="title">收货地址管理</div>
	    <div class="right">
	        <a href="{{$smarty.const.__PROJECT__}}"><img src="{{$smarty.const.__APP__}}images/homeon.png" alt=""></a>
	    </div>
	</div>
</div>
<div class="container addr_content">
	{{if !$address}}
	<div class="win_empty">
		<i></i>
	</div>
	{{else}}
	<div class="addr_main">
		<ul>
			{{if $address}}
			{{foreach from=$address item=val}}
			<li class="addr_li {{if $smarty.get.selected==$val.id}}selected{{/if}}" addr='{{$val.id}}'>
				<div class="name-tel">
					<span class="name">{{$val.name}}</span>
					<span class="tel">{{$val.tel}}</span>
				</div>
				<div class="address">{{$val.region}}&nbsp;{{$val.address}}</div>
				<div class="set">
					<a class="set-default ajaxSubmit refresh"  link="index.php?app=address&act=setDefault&id={{$val.id}}">
					  <input type="checkbox" id="default_{{$val.id}}"  {{if $val.hot == '1'}}checked{{/if}} >
					  <label for="default_{{$val.id}}" class="{{if $val.hot == '1'}}checked{{/if}}">{{if $val.hot == '1'}}默认地址{{else}}设为默认{{/if}}</label>
					</a>
					<span class="delete">
						<a class="ajaxSubmit confirm refresh"  lang="删除将不可恢复，确定要删除吗？" link="index.php?app=address&act=delete&id={{$val.id}}" ><img src="{{$smarty.const.__APP__}}images/addr-delete.png" class="img"><span class="font">删除</span></a>
					</span>
					<span class="edit">
						<a href="index.php?app=address&act=modify&id={{$val.id}}{{if $smarty.get.aid}}&aid={{$smarty.get.aid}}{{/if}}"><img src="{{$smarty.const.__APP__}}images/addr-edit.png" class="img"><span class="font">编辑</span></a>
					</span>
				</div>	
			</li>
			{{/foreach}}
			{{/if}}
			
		</ul>
	</div>
	{{/if}}
	<div class='newaddress'>
		<a href="index.php?app=address&act=modify{{if $smarty.get.aid}}&aid={{$smarty.get.aid}}{{/if}}" style='display:block;'>
			添加新地址
		</a>
	</div>
</div>


{{if $smarty.get.aid}}
<script>
	$(function(){
		$('.addr_li').click(function(){
			event.stopPropagation();
			location.href='{{"index.php?app=order&act=address"|URL}}id-{{$smarty.get.aid}}/addr-'+$(this).attr('addr')+'/';
		});
	});
</script>
{{/if}}
{{include file="footer.html"}}